﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;

namespace BPMS.Utility.Net
{
    public class RequestItem
    {
        /// <summary>
        /// 获取或设置请求地址URL
        /// </summary>
        public string Url { get; set; }

        /// <summary>
        /// 获取或设置HTTP请求类型 默认为GET
        /// </summary>
        public string Method { get; set; }

        /// <summary>
        /// 获取或设置Post请求参数
        /// </summary>
        public byte[] PostData { get; set; }

        /// <summary>
        /// 获取或设置请求头集合
        /// </summary>
        public WebHeaderCollection RequestHeaders { get; set; }

        /// <summary>
        /// 获取或设置Cookie集合
        /// </summary>
        public CookieCollection Cookies { get; set; }

        /// <summary>
        /// 获取或设置 Accept HTTP 标头的值
        /// </summary>
        public string Accept { get; set; }

        /// <summary>
        /// 获取或设置是否允许URL跳转
        /// </summary>
        public bool AllowRedirect { get; set; }

        /// <summary>
        /// 获取或设置请求超时的毫秒数
        /// </summary>
        public int RequestTimeout { get; set; }

        /// <summary>
        /// 获取或设置数据读写的超时毫秒数
        /// </summary>
        public int ReadWriteTimeout { get; set; }

        /// <summary>
        /// 获取或设置代理实例
        /// </summary>
        public IWebProxy Proxy { get; set; }

        /// <summary>
        /// 获取或设置请求头的User-Agent设置
        /// </summary>
        public string UserAgent { get; set; }

        /// <summary>
        ///  获取或设置Url Referer
        /// </summary>
        public string Referer { get; set; }

        /// <summary>
        /// 获取或设置请求的编码方式
        /// </summary>
        public Encoding RequestEncoding { get; set; }

        /// <summary>
        /// 是否与服务器建立持久链接
        /// </summary>
        public bool KeepAlive { get; set; }

        /// <summary>
        /// 获取或设置 Content-type HTTP 标头的值
        /// </summary>
        public string ContentType { get; set; }
    }
}
